#ifndef USRAI_H
#define USRAI_H

#include "AI.h"

extern tagGame tagUsrGame;
extern ins UsrIns;
/*##########DO NOT MODIFY THE CODE ABOVE##########*/

class UsrAI:public AI
{
public:
    UsrAI(){this->id=0;}
    ~UsrAI(){}
     void findland();
     void fishing();
     void search();
     void stop(tagArmy&army);
     void cuttree(tagFarmer&farmer);
     void hunting(tagFarmer&farmer, int n);
     void killelephant(tagFarmer&farmer,int i);
     void killsheep(tagFarmer&farmer);
     void build(tagFarmer&farmer,int ty,int&x,int&y);
     void landing();
     void searcharea();
     void findgold();
     void fighting();
     void makearmy();
     void mininggold(tagFarmer&farmer);
     void getgold();
     void f0();
     void f1();
     void f2();
     void f3();
     void f4();
private:
    void processData() override;
    tagInfo getInfo(){return tagUsrGame.getInfo();}
    int AddToIns(instruction ins) override
    {
        UsrIns.lock.lock();
        ins.id=UsrIns.g_id;
        UsrIns.g_id++;
        UsrIns.instructions.push(ins);
        UsrIns.lock.unlock();
        return ins.id;
    }
    void clearInsRet() override
    {
        tagUsrGame.clearInsRet();
    }
    /*##########DO NOT MODIFY THE CODE IN THE CLASS##########*/
    bool tryBuildBuilding(int buildingType, int requiredWood, int maxCount, int reqiredBuilding,int is_settler=0);
    //
};

/*##########YOUR CODE BEGINS HERE##########*/
    
/*##########YOUR CODE ENDS HERE##########*/
#endif // USRAI_H
